package com.zy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.entity.Post;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * Created with IntelliJ IDEA.
 * @Auther: 杨深俊
 * @Date: 2021/04/14/18:47
 * @Description: 
 */
@Repository
@Mapper
public interface ZyPostMapper extends BaseMapper<Post> {
    @Delete("delete from post where post_id = #{postId}")
    public void delPost(Integer id);

    @Delete("delete from post_department_mapping where post_id = #{postId}")
    public void delPosts(Integer id);

    @Update("update post set post_name = #{postName},post_descript = #{postDescript} where post_id = #{postId}")
    public void updatePost(Post post);

    @Select("select post_id,post_name,post_descript from post where post_id = #{postId}")
    public Post getPost(Integer id);
}
